package cn.com.css.taxInspection.xtgl.service.impl;

import cn.com.css.taxInspection.util.TsBqUtils;
import cn.com.css.taxInspection.xtgl.entity.ZbcxEntity;
import cn.com.css.taxInspection.xtgl.mapper.SysZbcxMapper;
import cn.com.css.taxInspection.xtgl.service.SysZbcxService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service("SysZbcxService")
public class SysZbcxServiceImpl extends ServiceImpl<SysZbcxMapper, ZbcxEntity> implements SysZbcxService {

    @Override
    public ZbcxEntity queryZbcxData(ZbcxEntity zbcxEntity) {
        LambdaQueryWrapper<ZbcxEntity> queryWrapper = Wrappers.lambdaQuery();
        if (TsBqUtils.isNotNull(zbcxEntity.getCode())) {
            queryWrapper.eq(ZbcxEntity::getCode, zbcxEntity.getCode());
        }
        return this.getOne(queryWrapper, false);
        // 第二个参数false表示如果查到多条不报错，只返回第一条
    }


}